<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="css/style.css">
    <title>个人聊天室</title>

</head>
<body>
    
    <div class="main">
        <div class="left">
             <div class="top" style="overflow:scroll;">
                  <ul id="msgs">
                        <!-- <li class="msg">
                             <span class="from">xxxx 说：</span>
                             <div class="words"> hello world !</div>
                        </li> -->
                 
                  </ul>
             </div>
             <div class="bottom">

                <div class="input">
                    <textarea name="message" class="message" id="message"></textarea>
                </div>
                <div class="sendbutton"><input type="button" name="send" value="send" class="send" id="send" /></div>
             </div>
        </div>
        <div class="right">
            <ul class="memberlist" id="memberlist">
                <li> <span class="online">■</span>游云随风</li>
            </ul>
        </div>
        <div style="clear:both;"></div>
        
    </div>
    <input type="hidden" name="uid" value="" id='uid' />
    <script src="./js/common.js" language="javascript"></script>
    <script>
        (function(){

            var uid = document.getElementById("uid").value;
            if(uid == ''){
                var uid = window.prompt("请设置一个名称，以便通讯.");
                var chkUid = /\w+/;
                if(!chkUid.test(uid)){
                    alert("名称格式不正确，名称 应该由 字母 数字  组成");
                    window.location.reload();
                    return ;
                }

                document.getElementById("uid").value = uid;

                alert("设置成功")
            }

        })();


        start();   
        

        
    </script>


</body>
</html>

